
package com.fire.eyes.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.fire.eyes.dao.FireMaintainorMapper;
import com.fire.eyes.model.FireMaintainorModel;
import com.fire.eyes.service.IFireMaintainorService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.plugins.Page;

import java.util.List;
import java.util.Map;

/**
 * 维保单位Service
 *
 * @author Matthew
 * @Date 2019-01-17 20:48
 */
@Service
public class FireMaintainorServiceImpl extends ServiceImpl<FireMaintainorMapper, FireMaintainorModel> implements IFireMaintainorService{

    private static final Logger LOGGER = LoggerFactory.getLogger(FireMaintainorServiceImpl.class);

    @Autowired
    private FireMaintainorMapper fireMaintainorMapper;

    @Override
    public FireMaintainorModel selectOne(FireMaintainorModel entity){
        return fireMaintainorMapper.selectOne(entity);
    }

    @Override
    public List<FireMaintainorModel>selectList(FireMaintainorModel model){
        return fireMaintainorMapper.selectListByModel(model);
    }

    @Override
    public Page<FireMaintainorModel> selectPage(int currentPage, int pageSize, Wrapper<FireMaintainorModel> wrapper){
        return selectPage(new Page<FireMaintainorModel>(currentPage,pageSize), wrapper);
    }

    @Override
    public Page<Map<String, Object>> selectMapsPage(int currentPage, int pageSize, Wrapper<FireMaintainorModel> wrapper){
        return selectMapsPage(new Page<FireMaintainorModel>(currentPage,pageSize), wrapper);
    }

    @Override
    public Map<String, Object> queryMaintainor(String maintainor){
        return fireMaintainorMapper.queryMaintainor(maintainor);
    }

    @Override
    public Page<Map<String, Object>> queryMyMaitainorsList(Page<Map<String, Object>> page, String supervisor) {
        return page.setRecords(fireMaintainorMapper.queryMyMaitainorsList(page, supervisor));
    }

}
